var fs = require('fs');
var iconvlite = require('iconv-lite');

function readFileSync_encoding(filename) {
    var content = fs.readFileSync(filename);
    return iconvlite.decode(content, 'gbk');
}

var dir = './data/旧约/37_撒迦利亚书-14章';
var files = fs.readdirSync(dir);


var tmp = {
	contents: []
};

files.forEach(function(f){
	if(f == '.' || f == '..' || f == '.DS_Store'){
		return;
	}

	var content = readFileSync_encoding(dir + '/' + f);

	var bbb = [];

	content.split('\r\n').forEach(function(lineContent){
		lineContent = lineContent.trim();
		var i = lineContent.indexOf('　');
		if(i > 0){
			lineContent = lineContent.substr(i + 1);
			bbb.push(lineContent);
		}
	});

	tmp.contents.push({
		content: bbb
	});

	
});

console.log(JSON.stringify(tmp.contents));